package com.liu.sx.controller;

import com.liu.sx.common.entity.PageResult;
import com.liu.sx.common.entity.Result;
import com.liu.sx.common.status.CodeEnum;
import com.liu.sx.entity.Driver;
import com.liu.sx.entity.DriverLogin;
import com.liu.sx.service.DriverLoginService;
import com.liu.sx.service.DriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/driverlogin")
public class DriverLoginController {

    @Autowired
    private DriverLoginService driverLoginService;

    @GetMapping
    public Result findAll(int page, int rows , String query){

        Page<DriverLogin> pages = driverLoginService.findAll(page,rows,query);

        return  new Result(true, CodeEnum.OK.getCode(),"查询成功",new PageResult<DriverLogin>(pages.getTotalElements(),pages.getContent()));
    }




}
